<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="app" uri="/application" %>
<%@ taglib  prefix="s"  uri="/struts-tags"%>
<%@ taglib  prefix="s"  uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>站点管理_添加站点</title>
<link href="/css/role.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!-- title -->
<div class="right_title">
  <div class="h">系统模块->添加UI常量</div>
</div>
<!-- title end -->
<div class="zdgl">

 <form action="/uiconts/su_conts_ui.shtml" name="uiconts" onsubmit="return validate.getSubmit()();" method="post" enctype="multipart/form-data">
  <input name="id" value="${uiconts.id}" type="hidden" />
  <div class="line">
    <div class="td_left">父级 pcode：</div>
    <div>
      <c:choose>
         <c:when test="${empty pcode}">0(根节点)</c:when>
         <c:otherwise>${pcode}<input name="pcode" value="${pcode}" type="hidden"/></c:otherwise>
      </c:choose>
    </div>
  </div>
   <div class="line clear">
    <div class="td_left">常量名称：</div>
    <div>
      <input type="text" name="cu.uiName" value="${uiconts.uiName}" maxlength="20" class="w_180" />
    </div>
  </div>
  <div class="line clear">
    <div class="td_left">排序：</div>
    <div>
      <input type="text" name="cu.lev" value="${uiconts.lev}" class="w_180" maxlength="20" />
    </div>
  </div>
  <div class="line clear">
    <div class="td_left">色值：</div>
    <div>
      <input type="text" name="cu.colorValue" class="w_180" value="${uiconts.colorValue}" maxlength="20" />
    </div>
  </div>
   <div class="line clear">
    <div class="td_left">宠物类型：</div>
    <div>
      <input type="text" name="cu.petBreeds" class="w_180" value="${uiconts.petBreeds}" maxlength="20" />
    </div>
  </div>
  <div class="line clear">
    <div class="td_left">分类类型：</div>
    <div>
      <input type="text" name="cu.petCate" class="w_180" value="${uiconts.petCate}" maxlength="20" />
    </div>
  </div>
  <div class="line clear">
    <div class="td_left">进口类型：</div>
    <div>
      <input type="text" name="cu.petImport" class="w_180" value="${uiconts.petImport}" maxlength="5" />
    </div>
  </div>
  <div class="line clear">
    <div class="td_left">图片上传：</div>
    <div>
     <input name="imgFile" value="" type="file" size="20"  class="inputwidth01"  />
        <c:if test="${!empty uiconts.imgPath}">
          <br/><app:image src="${uiconts.imgPath}"></app:image>
        </c:if>
    </div>
  </div>
   <div class="sub clear"><input class="blue_btn" type="submit" name="sm" value="确定"/>&nbsp;<input class="blue_btn" onclick="come_back();" type="button" name="sm" value="返回列表" /> </div>
   
   </form>

</div>
</body>
</html>
<script type="text/javascript" src="/scripts/util.js"></script>	
<script type="text/javascript" src="/scripts/east.js"></script>	
<script type="text/javascript" src="/scripts/form_validate.js"></script>
<script type="text/javascript" src="/scripts/mini.js"></script>
<script type="text/javascript">
    validate.addvalidte(document.uiconts,{
        rules:{
        	uiName:{checkNull:true},
        	constantId:{checkNull:true,isNumber:true}
           },
	    message:{
	    	uiName:{checkNull:"必填项!"},
	    	constantId:{checkNull:"请输入排序数字！",isNumber:"请输入排序数字！"}
	    },
	    errorPlacement:function(e,m){
	       ep(e,m);
	    },
	    success:function(e){
	        suc(e);
	    }
	    });
	

	function ep(e,m){
	   var tag = e.getAttribute('warn');
	       if(tag!='true'){
	         e.setAttribute('warn','true');
	         var div = util.cElem('label',{className:'error',cssText:'',id:e.name+'_error'},m);
	         insertAfter(div,e);
	       }
	}
	
	function suc(e){
	    var o = util.$(e.name+'_error');
		o && o.parentNode && (o.parentNode.removeChild(o));
		e.setAttribute('warn','false');
	}
	    
	function _submit(th){
      	if(validate.getSubmit()() ){
	       document.uiconts.submit();
	       th.disabled = "disabled";
	    }
	}
</script>

